﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConfigServer;
using System.Windows.Forms;

namespace TuongLai_Schools
{
    class clsCommon
    {
        public static string sConnectionString = String.Format("server={0};User id={1};password={2};database = {3}", ConfigServer.Config.strServername, ConfigServer.Config.strUsername, ConfigServer.Config.strPassword, ConfigServer.Config.strDatabasename);
        public static void SaveSuccessfully()
        {
            MessageBox.Show("Lưu thành công.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public static void SaveNotSuccessfully()
        {
            MessageBox.Show("Lưu không thành công.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        public static DialogResult ConfirmDeletion(string tenchuoi)
        {
            return MessageBox.Show("Bạn có chắc chắn muốn xoá hay không ?: "+tenchuoi, "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
        public void GetForm(Form subform, Panel _panel)
        {
            _panel.Controls.Clear();
            subform.FormBorderStyle = FormBorderStyle.None;
            subform.TopLevel = false;
            subform.ShowInTaskbar = false;
            subform.Show();
            subform.Dock = DockStyle.Fill;
            _panel.Controls.Add(subform);
        }
    }
}
